package com.yry.timertask.chapter34;

import java.text.SimpleDateFormat;
import java.util.TimerTask;

public class DancingRobot extends TimerTask {


	@Override
	public void run() {
		//获取最近的异常任务执行的时间，并将其格式化
		SimpleDateFormat sf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		System.out.println("Scheduled exec time is:"+sf.format(scheduledExecutionTime()));
		System.out.println("Dancing happily");
	}
}
